package com.changpay.zywy.adapter

import android.content.Context
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.changpay.zywy.R
import com.changpay.zywy.bean.MyMachineBean
import com.changpay.zywy.utils.ImageLoader

/**
 * Created by chenxz on 2018/4/22.
 */
class MyMachineAdapter(private val context: Context?, datas: MutableList<MyMachineBean.ListBean>)
    : BaseQuickAdapter<MyMachineBean.ListBean, BaseViewHolder>(R.layout.item_my_machine, datas) {

    override fun convert(helper: BaseViewHolder?, item: MyMachineBean.ListBean?) {
        item ?: return
        helper ?: return
        helper.setText(R.id.tv_shop_name,item.gc_name)
            .setText(R.id.tv_name,item.goods_name)
            .setText(R.id.tv_name_two,item.goods_serial)
            .setText(R.id.tv_money, "¥${item.goods_price}")
            .setText(R.id.tv_number,"x${item.goods_count_num}")
            .addOnClickListener(R.id.tv_fen_run)
        ImageLoader.load(item.goods_image,helper.getView(R.id.iv_image))
    }

}
